import java.util.Scanner;//导入Scanner包

public class Task {
    //关于x的函数
    public static int func(int x){
        int y = 0;
        if(x < 0){//小于0
           return y = x*x - 1;
        }else if(x == 0){
            return y = 0;
        }else {//大于0
            return y = x +3;
        }
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);//从键盘中读入一个数据
        System.out.println("王雅钊，请输入一个整数：");
        while(scan.hasNext()){//循环输入
         int x = scan.nextInt();
         System.out.println("y = "+ func(x));//调用fun（）函数
        }
    }
}
